package aModelLayer;

public class Item {
	
	private String name;
	private int ref;
	private int score;
	private int[] effect;
	private int usable;
	private String description;
	
	public Item(int ref) {
		int temp = 0;
		name = Messages.getString("Item." + Integer.toString(ref) + Integer.toString(temp));
		this.ref = ref;
		temp++;
		score = Integer.parseInt(Messages.getString("Item." + Integer.toString(ref) + Integer.toString(temp)));
		effect = new int[8];
		for(int i = 0; i < effect.length; i++) {
			temp++;
			effect[i] = Integer.parseInt(Messages.getString("Item." + Integer.toString(ref) + Integer.toString(temp)));
		}
		temp++;
		usable = Integer.parseInt(Messages.getString("Item." + Integer.toString(ref) + Integer.toString(temp)));
		temp++;
		description = Messages.getString("Item." + Integer.toString(ref) + Integer.toString(temp));
	}
	
	public boolean isItem() {
		if (effect[2] != 0)
			return true;
		if (effect[3] != 0)
			return true;
		if (effect[4] != 0)
			return true;
		if (effect[5] != 0)
			return true;
		if (effect[6] != 0)
			return true;
		if (effect[7] != 0)
			return true;
		return false;
	}
	
	public String getName() {
		return name;
	}
	
	public int getRef() {
		return ref;
	}
	
	public int getScore() {
		return score;
	}
	
	public int getCurrentHealth() {
		return effect[0];
	}
	
	public int getCurrentMana() {
		return effect[1];
	}
	
	public int getMaxHealth() {
		return effect[2];
	}
	
	public int getMaxMana() {
		return effect[3];
	}
	
	public int getStrength() {
		return effect[4];
	}
	
	public int getDefense() {
		return effect[5];
	}
	
	public int getSpeed() {
		return effect[6];
	}
	
	public int getMagic() {
		return effect[7];
	}
	
	public int getUsable() {
		return usable;
	}
	
	public String getDescription() {
		return description;
	}
}